package com.spring.utils.api_v4.controller.ui;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.spring.utils.api_v4.pojo.UserInfo;
import com.spring.utils.api_v4.util.DoubleSerialize;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.time.LocalDate;

/**
 * 工资信息
 */
@Getter
@Setter
@ToString(exclude = "userInfo")
public class EmployeeWageItem {
    private String id;
    @JsonIgnore
    private UserInfo userInfo;      // 用户信息
    private LocalDate createDate;   // 创建时间

    /********基础工资************/
    @JsonSerialize(using = DoubleSerialize.class)
    protected double posPay;       // 岗位工资
    @JsonSerialize(using = DoubleSerialize.class)
    protected double salaryPay;    // 薪级工资
    @JsonSerialize(using = DoubleSerialize.class)
    protected double ratio;        // 提高10%

    /********绩效工资************/
    @JsonSerialize(using = DoubleSerialize.class)
    protected double monthMerit;   // 月份基础绩效
    @JsonSerialize(using = DoubleSerialize.class)
    protected double yearMerit;    // 年末绩效工资
    @JsonSerialize(using = DoubleSerialize.class)
    protected double extraLessonMerit; // 超课时绩效
    @JsonSerialize(using = DoubleSerialize.class)
    protected double counsellorAllowance;  // 辅导员津贴
    @JsonSerialize(using = DoubleSerialize.class)
    protected double specialMerit;     // 专项奖惩绩效
    @JsonSerialize(using = DoubleSerialize.class)
    protected double overtimeMerit;    // 加班绩效

    /********津贴补贴************/
    @JsonSerialize(using = DoubleSerialize.class)
    protected double reformPay;        // 改革性补贴
    @JsonSerialize(using = DoubleSerialize.class)
    protected double reservePart;      // 工改保留
    @JsonSerialize(using = DoubleSerialize.class)
    protected double newEmpSubsidy;    // 2000年1月1日参加工作补贴
    @JsonSerialize(using = DoubleSerialize.class)
    protected double talentIntroPay;   // 人才引进补贴
    @JsonSerialize(using = DoubleSerialize.class)
    protected double proLeaderPay;     // 学科带头人
    @JsonSerialize(using = DoubleSerialize.class)
    protected double officeDirectorPay;// 室主任津贴
    @JsonSerialize(using = DoubleSerialize.class)
    protected double technicianPay;    // 技师津贴
    @JsonSerialize(using = DoubleSerialize.class)
    protected double epidemicPay;      // 卫生防疫津贴
    @JsonSerialize(using = DoubleSerialize.class)
    protected double nursePay;         // 护龄津贴
    @JsonSerialize(using = DoubleSerialize.class)
    protected double securityPay;      // 安保人员特岗津贴
    @JsonSerialize(using = DoubleSerialize.class)
    protected double secretPay;        // 保密津贴
    @JsonSerialize(using = DoubleSerialize.class)
    protected double driverPay;        // 专职司机工作补贴
    @JsonSerialize(using = DoubleSerialize.class)
    protected double politicTeacherPay;// 思政教师岗位津贴
    @JsonSerialize(using = DoubleSerialize.class)
    protected double onlyChildPay;     // 独子费
    @JsonSerialize(using = DoubleSerialize.class)
    protected double examPay;          // 考务费
    @JsonSerialize(using = DoubleSerialize.class)
    protected double trafficPay;       // 交通补助

    /********福利************/
    @JsonSerialize(using = DoubleSerialize.class)
    protected double endowmentIns;     // 养老保险
    @JsonSerialize(using = DoubleSerialize.class)
    protected double careerIns;        // 职业年金
    @JsonSerialize(using = DoubleSerialize.class)
    protected double medicalIns;       // 医疗保险
    @JsonSerialize(using = DoubleSerialize.class)
    protected double unemploymentIns;        // 失业保险
    @JsonSerialize(using = DoubleSerialize.class)
    protected double housingProvidentFund;     // 住房公积金

    /********个税************/
    @JsonSerialize(using = DoubleSerialize.class)
    protected double individualIncomeTax;  //个税
    @JsonSerialize(using = DoubleSerialize.class)
    protected double totalDeduction;   // 代扣款合计

    public String getName() {
        return userInfo == null ? "" : userInfo.getName();
    }

    public int getAge() {
        return userInfo == null ? 0 : userInfo.getAge();
    }

    public String getSex() {
        return userInfo == null ? "" : userInfo.getSex();
    }

    public String getDept() {
        return userInfo == null ? "" : userInfo.getDepart().getName();
    }

    public String getUserId() {
        return userInfo == null ? "" : userInfo.getId();
    }

    public String getRawRole() { return userInfo == null ? "" : userInfo.getRawRole(); }
}
